﻿using System;

namespace enyo
{
    public class FilePicker : Popup
    {
        /// <summary>
        /// Optional string or array. Limits displayed files to the given type (or types).         
        /// </summary>        
        public FileType[] FileType { get; set; }

        /// <summary>
        /// Optional free form string to override the default string displayed at the top panel.
        /// </summary>
        public string PreviewLabel { get; set; }

        /// <summary>
        /// Optional array of file extension strings, used to filter displayed files.
        /// </summary>
        public string[] Extensions { get; set; }

        /// <summary>
        /// Optional boolean indicating if selection of multiple files is allowed.
        /// </summary>
        public bool AllowMultiSelect { get; set; }

        /// <summary>
        /// Optional string contains the current ringtone absolute file path.
        /// </summary>
        public string CurrentRingtonePath { get; set; }

        /// <summary>
        /// Optional int to set the width of the crop window.
        /// </summary>
        public int CropWidth { get; set; }

        /// <summary>
        /// Optional int to set the height of the crop window.
        /// </summary>
        public int CropHeight { get; set; }

        /// <summary>
        /// Sent with a response from the file picker (see above) when the user chooses a file.
        /// </summary>
        //TODO:type correct?
        public EnyoEvent<Control, FilePickInfo[]> onPickFile;

        /// <summary>
        /// Activates the modal FilePicker UI.
        /// </summary>
        public void PickFile()
        {
        }

        public void UpdateParams()
        {
        }
    }

    public class FilePickInfo
    {
        /// <summary>
        /// Absolute File Path.
        /// </summary>
        public string FullPath;

        /// <summary>
        /// Absolute File Path with ExtractFS prefix.
        /// </summary>
        public string IconPath;

        /// <summary>
        /// File Type (image, document, audio, video)
        /// </summary>
        public FileType AttachmentType;

        /// <summary>
        /// File Size in Bytes.
        /// </summary>
        public int Size;
    }
}
